import numpy as np
from sklearn import datasets
import matplotlib.pyplot as plt

digit = datasets.load_digits()
print(digit.data.shape)
print(digit.images.shape)

img = digit.images[0,:,:]
plt.imshow(img, cmap='gray')
plt.show()

for image_index in range(10):
    subplot_index = image_index+1
    plt.subplot(2,5,subplot_index)
    plt.imshow(digit.images[image_index, :, :], cmap='gray')

plt.show()